package com.mall.dao;

import com.mall.bean.Role;
import com.mall.bean.RoleExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface RoleMapper {
    long countByExample(RoleExample example);

    int deleteByPrimaryKey(Integer role_id);

    int insert(Role record);

    int insertSelective(Role record);

    List<Role> selectByExample(RoleExample example);

    List<Role> selectByExampleDef(RoleExample example);

    Role selectByPrimaryKey(Integer role_id);

    int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByExample(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    //<select id="selectByExample" parameterType="com.mall.bean.RoleExample" resultMap="BaseResultMap">
    Role getRoleByUserRoleUserId(String id);

    int removeBeforePermissions(Integer roleId);

    int addPermissions(@Param("roleId") Integer roleId,@Param("array") String[] pidArray);
}